import store from '@/store/index'

export const addFromValue = () => ({
  staffChildPOList1: [{ almaMater: '', educationalLevel: '', major: '' }],
  staffChildPOList2: [
    {
      workingCertificate: '',
      certificationTime: '',
      expirationTime: '',
      certificateEmployment: ''
    }
  ],
  staffChildPOList3: [{ almaMater: '', startStopTime: '', major: '' }],
  staffChildPOList4: [{ classesId: '', positionHeld: '', staffType: '' }]
})
// 从业证书
export const certificate = [
  {
    value: 0,
    label: '保育师'
  },
  {
    value: 1,
    label: '育婴员'
  },
  {
    value: 2,
    label: '托育师'
  },
  {
    value: 3,
    label: '小学教师资格证'
  },
  {
    value: 4,
    label: '幼儿教师资格证'
  },
  {
    value: 5,
    label: '其他'
  }
]

export const typeList = [
  {
    value: '',
    label: '全部'
  },
  {
    value: 5,
    label: '直播课'
  },
  {
    value: 6,
    label: '录播课'
  }
]

export const stateList = [
  {
    value: 0,
    label: '展示'
  },
  {
    value: 1,
    label: '屏蔽'
  }
]

export const teacherFileTable = [
  {
    name: '教师姓名',
    key: 'realName'
  },
  {
    name: '性别',
    key: 'gender',
    slot: true,
    slotValue: 'sex'
  },
  {
    name: '联系方式',
    key: 'mobile'
  },
  {
    name: '担任岗位',
    key: 'positionName'
  },
  {
    name: '入职日期',
    key: 'joinAt'
  },
  {
    name: '所属班级',
    key: 'classesName'
  },

  {
    name: '就职状态',
    key: 'statusName',
    state: true
  },

  {
    name: '离职日期',
    key: 'resignDate'
  }
]

export const teacherTrainingTable = [
  {
    name: '课程名称',
    key: 'name'
  },
  {
    name: '章节数量',
    key: 'chapterNum'
  },
  {
    name: '排序',
    key: 'priority'
  },
  {
    name: '状态',
    key: 'status',
    slot: true,
    options: stateList
  },
  {
    name: '创建时间',
    key: 'created'
  }
]

export const teacherTrainingInfoTable = [
  {
    name: '章节名称',
    key: 'name'
  },
  {
    name: '视频信息',
    key: 'videoAddress',
    url: true
  },
  {
    name: '排序',
    key: 'priority'
  },
  {
    name: '课程数量',
    key: 'chapterNum'
  },
  {
    name: '状态',
    key: 'status',
    slot: true,
    options: stateList
  },
  {
    name: '创建时间',
    key: 'created'
  }
]

export const liveBroadcastTable = [
  {
    name: '课程名称',
    key: 'name'
  },
  {
    name: '课程分类',
    key: 'type',
    slot: true,
    options: typeList,
    type: true
    // 5直播课程
    // 6录播课程
  },
  {
    name: '视频地址',
    key: 'videoAddress',
    url: true
  },
  {
    name: '状态',
    key: 'status',
    slot: true,
    options: stateList
  },
  {
    name: '创建时间',
    key: 'created'
  }
]

export const stateDate = [
  {
    value: '',
    label: '全部'
  },
  {
    value: 0,
    label: '在职'
  },
  {
    value: 1,
    label: '离职'
  }
]

export const addTeacher = [
  {
    type: 'input',
    label: '姓名',
    value: 'realName',
    placeholder: '请输入'
  },
  {
    type: 'select',
    label: '性别',
    value: 'gender',
    option: store.getters.dict.sex,
    placeholder: '请选择性别'
  },
  {
    type: 'input',
    label: '身份证号',
    value: 'idCard',
    placeholder: '请输入'
  },
  {
    type: 'picker',
    label: '出生日期',
    value: 'birthTime',
    placeholder: '请选择',
    valueFormat: 'yyyy-MM-dd',
    pickerOptions: {
      disabledDate (date) {
        return date.getTime() > Date.now()
      }
    }
  },
  {
    type: 'input',
    label: '年龄',
    value: 'age',
    placeholder: '请输入'
  },
  {
    type: 'input',
    label: '联系方式',
    value: 'contactInformation',
    placeholder: '请输入'
  },
  {
    type: 'input',
    label: '民族',
    value: 'nationality',
    placeholder: '请输入'
  },
  {
    type: 'input',
    label: '家庭住址',
    value: 'homeAddress',
    placeholder: '请输入'
  },
  {
    type: 'input',
    label: '现住地址',
    value: 'currentAddress',
    placeholder: '请输入'
  },
  {
    type: 'input',
    label: '紧急联系人',
    value: 'emergencyName',
    placeholder: '请输入'
  },
  {
    type: 'input',
    label: '紧急联系人联系方式',
    value: 'emergencyMobile',
    placeholder: '请输入'
  },
  {
    type: '',
    label: '',
    value: '',
    placeholder: ''
  },
  {
    type: 'upload',
    label: '工作形象照',
    value: 'workFormPhoto',
    action: '',
    listType: false
  }
]

export const addTeacherRules = {
  realName: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
  gender: [{ required: true, message: '请选择性别', trigger: 'change' }],
  idCard: [
    { required: true, message: '请输入身份证号', trigger: 'blur' },
    {
      pattern:
        /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/,
      message: '证件号码格式有误！',
      trigger: 'blur'
    }
  ],
  birthTime: [
    {
      required: true,
      message: '请选择出生日期',
      trigger: 'change'
    }
  ],
  age: [{ required: true, message: '请输入年龄', trigger: 'blur' }],
  nationality: [{ required: true, message: '请输入民族', trigger: 'blur' }],
  contactInformation: [
    { required: true, message: '请输入联系方式', trigger: 'blur' },
    {
      pattern: /^1[3456789]\d{9}$/,
      message: '请输入正确的手机号',
      trigger: 'blur'
    }
  ],
  homeAddress: [{ required: true, message: '请输入家庭住址', trigger: 'blur' }],
  currentAddress: [
    { required: true, message: '请输入现住地址', trigger: 'blur' }
  ],
  emergencyName: [
    { required: true, message: '请输入紧急联系人', trigger: 'blur' }
  ],
  emergencyMobile: [
    { required: true, message: '请输入紧急联系人联系方式', trigger: 'blur' },
    {
      pattern: /^1[3456789]\d{9}$/,
      message: '请输入正确的手机号',
      trigger: 'blur'
    }
  ]
}

export const addTrainingFrom = [
  {
    type: 'input',
    label: '课程名称',
    value: 'name',
    placeholder: '请输入课程名称'
  },
  {
    type: 'input',
    label: '优先级',
    value: 'priority',
    placeholder: '请输入优先级'
  },
  {
    type: 'textarea',
    label: '课程简介',
    value: 'introduction',
    placeholder: '请输入课程简介',
    autosize: { minRows: 5, maxRows: 7 }
  },
  {
    type: 'upload',
    label: '课程封面',
    value: 'courseCover',
    action: ''
  }
]

export const addLiveDate = {
  type: [{ required: true, message: '请选择课程类型', trigger: 'change' }],
  name: [{ required: true, message: '请输入课程名称', trigger: 'blur' }],
  videoAddress: [
    { required: true, message: '请输入视频链接', trigger: 'blur' }
  ],
  courseCover: [
    {
      required: true,
      message: '请上传课程封面',
      trigger: 'change'
    }
  ]
}

export const addFromDate = [
  {
    type: 'select',
    label: '课程类型',
    value: 'type',
    option: typeList.slice(1),
    placeholder: '请选择课程类型'
  },
  {
    type: 'input',
    label: '课程名称',
    value: 'name',
    placeholder: '请输入课程名称'
  },
  {
    type: 'input',
    label: '视频链接',
    value: 'videoAddress',
    placeholder: '请输入视频链接'
  },
  {
    type: 'input',
    label: '优先级',
    value: 'priority',
    placeholder: '请输入优先级'
  },
  {
    type: 'textarea',
    label: '课程简介',
    value: 'introduction',
    placeholder: '请输入课程简介',
    autosize: { minRows: 7, maxRows: 10 }
  },
  {
    type: 'upload',
    label: '课程封面',
    value: 'courseCover',
    action: ''
  }
]

export const addRreFrom = [
  {
    type: 'input',
    label: '教学能力',
    value: 'teachingAbility',
    placeholder: '请输入得分'
  },
  {
    type: 'input',
    label: '工作态度',
    value: 'workingAttitude',
    placeholder: '请输入得分'
  },
  {
    type: 'input',
    label: '专业素养',
    value: 'professional',
    placeholder: '请输入得分'
  },
  {
    type: 'rate',
    label: '家长满意度',
    value: 'parentalSatisfaction'
  },
  {
    type: 'input',
    label: '其他',
    value: 'other',
    placeholder: '请输入得分'
  }
  // {
  //   type: "input",
  //   label: "最终得分",
  //   value: "finalScore",
  //   placeholder: "",
  //   disabled: true,
  // },
  // {
  //   type: "textarea",
  //   label: "评语",
  //   value: "comment",
  //   placeholder: "若无可不填写",
  // },
]

export const addRreRulesDate = {
  staffId: [{ required: true, message: '请选择考核对象', trigger: 'change' }],
  month: [{ required: true, message: '请选择考核月份', trigger: 'change' }]
}
